<?php

require_once(dirname(__FILE__).'/MixiDataAPI.php');
require_once(dirname(__FILE__).'/Constants.php');
require_once(dirname(__FILE__).'/Config.php');

class People {

    function get_self ($user, $app_id) {
        if (!$user) return;
        $self_info = MixiDataAPI::get($user, $app_id, '/people/@me/@self');
        return $self_info;
    }

    function get_friend ($user, $app_id, $friend) {
        $api = '/people/@me/@self';
        $friend_info = MixiDataAPI::get($user, $app_id, $api);

        return $friend_info;
    }

    function get_optin_friends ($user, $app_id) {
        $api = '/people/@me/@friends';
        $friends_info = MixiDataAPI::get($user, $app_id, $api, array('filterBy' => 'hasApp'));

        return $friends_info;
    }
    
    function get_friends ($user, $app_id) {
        if (!$user) return array() ;
        $api = '/people/@me/@friends';
        $friends_info = MixiDataAPI::get($user, $app_id, $api);
        
        return $friends_info;
    }
    
}
